function vtt(data,isWords){
    //将vtt 转换成一个数组
    let regex = /(\d{2}:\d{2}:\d{2}\.\d+)\s*-->\s*(\d{2}:\d{2}:\d{2}\.\d+)(?:[\r\n|\r]*)([\s\S]+?)[\r\n|\r]([\s\S]+?)[\r\n|\r]{2}/g
    let regexOne  = /(\d{2}:\d{2}:\d{2}\.\d+)\s*-->\s*(\d{2}:\d{2}:\d{2}\.\d+)(?:[\r\n|\r]*)([\s\S]+?)[\r\n|\r]([\s\S]+?)[\r\n|\r]{2}/
    let matchResult = data.match(regex)
    let result = {}
    let tmp = []
    if(isWords){
        for(let i = 0; i< matchResult.length; i++ ){
            tmp = matchResult[i].match(regexOne)
            let seconds = countTime(tmp[1])
            result[seconds] = {
                cn:tmp[3],
                en:tmp[4]?tmp[4].split(/[\s,\.;]+/):''

            }
            if(i == 20){
                //console.log(result)
            }
        }
    }else{
        for(let i = 0; i< matchResult.length; i++ ){
            tmp = matchResult[i].match(regexOne)
            let seconds = countTime(tmp[1])
            let end = countTime(tmp[2])

            result[seconds] = {
                cn:tmp[3],
                en:tmp[4],
                end
            }
            if(i == 20){
                //console.log(result,'sentence')
            }
        }
    }

    //同一秒出现的台词要合并

    return result
}


function countTime(timeStr){
    let regex = /(\d{2}):(\d{2}):(\d{2})\.(\d+)/
    let match = timeStr.match(regex)

    return parseInt(match[1])*3600 + parseInt(match[2])*60 + parseInt(match[3])
}

function splitEnglish(sentence){
    let regex = /[a-zA-Z]+([\s,\.]+)/;
}


